import http from "@/http/index.ts"
import {User, UserListParam} from '@/api/user/type.ts'


// 新增
export const addApi = (data: User) => {
    return http.post("/user/createUser", data)
}


// 列表
export const getListApi = (data:UserListParam) => {
    return http.get("/user/getUserList",data)
}

// 列表
export const getSimpleUser = () => {
    return http.get("/user/simpleList",)
}


//根据用户id查询用户角色
export const getUserRoleApi = (userId:number) => {
    return http.get('/user/getUserRole',{userId:userId})
}

// 编辑
export const editApi = (data: User) => {
    return http.put("/user/updateUser", data)
}


// 删除
export const deleteApi = (userId: number) => {
    return http.delete(`/user/deleteUser/${userId}`)
}


// 重置密码
export const resetPasswordApi = (userId: number) => {
    return http.put(`/user/resetPassword/${userId}`)
}

